$(function(){
	$('#saveForm').validate({
		rules: {
			costMonth       :{required:false},
			file      :{required:true}
		},messages:{
			costMonth :{required:"必填"},
			file :{required:"必填"}
        }
 	});
	var myData = {
	            "CnName": "zhangyong",
	            "EnName":"blackoon"
	 };
	 var ajaxFormOption = {
             type: "post",  //提交方式  
//             dataType: "json", //数据类型  
             data: myData,//自定义数据参数，视情况添加
//             url: "upload?type=ajaxForm", //请求url  
             success: function (data) { //提交成功的回调函数 
            	 if (data.status == "1") {
                     pageaction();
                     closeDialog();
                     alert("保存成功");
                 } else {
                     alert(data.info);
                 }
//                 document.write("success");
             }
         };
	$('.saveBtn').click(function(){
		 if($('#saveForm').valid()){
	//		 $('#saveForm').submit();
			 $("#saveForm").ajaxSubmit(ajaxFormOption);
			 return false;
		}else{
			alert('数据验证失败，请检查！');
		}
	});
});

